<?php

class TransactionVisitShopAction extends SzAbstractAction
{
    protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT
    );

    /**
     * 获取玩家商铺
     *
     * @param int $userId
     * @param int $visitUserId
     * @param int $reqTime
     * @return SzResponse
     */
    public function execute($userId, $visitUserId, $reqTime)
    {
        if (!GameService::get()->verifySysUnlock($userId, GameConst::FUNC_TRANSACTION_FUNC)) {
            return $this->buildResponse(false);
        }
        GameService::get()->validateMultiRequestTimeDelta($userId, $reqTime);

        $transactionShops = TransactionService::get()->goToUserShop($visitUserId);

        return $this->buildResponse(
            ($transactionShops) ? $transactionShops->toArray() : true
        );
    }

}